<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加成功</title>
    <link href="/css/footer.css" rel="stylesheet">
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/success.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row justify-content-center align-items-center vh-100">
        <div class="col-md-4">
            <div class="card shadow">
                <div class="card-body">
                    <h3 class="text-center mb-4">添加成功</h3>
                    <p>会员编号：<span th:text="${userId}"></span></p>
                    <p>名字：<span th:text="${userName}"></span></p>
                    <p>积分：<span th:text="${userScore}"></span></p>
                    <p>电话：<span th:text="${userTel}"></span></p>
                    <p>性别：<span th:text="${userSex}"></span></p>
                    <p class="text-center">继续<a th:href="@{/userController/goAdd}">添加</a></p>
                    <p class="text-center">跳转到<a th:href="@{/userController/doSearch}">首页</a></p>
                </div>
            </div>
        </div>
    </div>
</div>

<footer>
    Copyleft © 2024 uu. All rights reversed. 😉
</footer>
</body>
</html>
<script>
    // 获取服务器传递的用户信息
    const userId = /*[[${userId}]]*/ "";
    const userName = /*[[${userName}]]*/ "";
    const userScore = /*[[${userScore}]]*/ "";
    const userTel = /*[[${userTel}]]*/ "";
    const userSex = /*[[${userSex}]]*/ "";

    // 将用户信息存储到 localStorage
    localStorage.setItem('userId', userId);
    localStorage.setItem('userName', userName);
    localStorage.setItem('userScore', userScore);
    localStorage.setItem('userTel', userTel);
    localStorage.setItem('userSex', userSex);
</script>
